package com.zk.yygh.hosp.controller;

import com.zk.yygh.hosp.result.Result;
import com.zk.yygh.hosp.service.DepartmentService;
import com.zk.yygh.hosp.service.ScheduleService;
import com.zk.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: 张凯
 * @date: 2022/6/8 - 10:07
 */
@Api("科室显示")
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("根据医院编号查询树形的科室数据")
    @GetMapping("getDepartment/{hoscode}")
    public Result getDepartmentByHoscode(@PathVariable("hoscode") String hoscode){
        List<DepartmentVo> schedule = departmentService.getDepartmentTree(hoscode);
        return Result.ok(schedule);
    }
}
